<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import("Think.Util.AdvModel");
class UserModel extends Model{

    protected $autoTimeFormat = 'Y-m-d H:i:s';

    //osuit_user表结构
    protected $fields = array(
        'user_id',
        'user_name',
        'user_pwd',
//        'user_crtdate',
//        'user_upddate',
        '_pk' => 'user_id',
    );

    //表单对应数据库字段
    protected $_map = array(
      'userId' => 'user_id',
      'userName' => 'user_name',
      'userPwd' => 'user_pwd'
    );

    //自动完成字段设置
    protected $_auto = array(
        array('user_pwd', 'md5', model::MODEL_BOTH, 'function'),
        //array('user_crtdate', 'time', model::MODEL_INSERT, 'fucntion'),
        //array('user_upddate', 'time', model::MODEL_BOTH, 'function'),
    );
    
    protected $autoCreateTimestamps = array('user_crtdate');
    protected $autoUpdateTimestamps = array('user_upddate');

    //设置只读字段
    protected $readonlyField = array('user_id', 'user_name', 'user_crtdate');
    
}

?>
